<template>
  <div>
    <el-link type="primary" :href="href" @click="downloadHandle">
      {{ title }}
    </el-link>
  </div>
</template>

<script setup>
import { ElMessageBox } from "element-plus";
/*
不建议title和插槽同时使用
*/
const props = defineProps({
  // 链接
  href: {
    default: "",
  },
  title: {
    default: "下载查看",
  },
});
const downloadHandle = () => {
  if (props.href === "") {
    ElMessageBox({ message: "资源暂时为空", type: "error" });
  }
  console.log("elec-file-link 下载文件！！");
};
</script>

<style lang="scss"></style>
